package com.class04.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * @ClassDescription:
 * 可以被web项目加载，会初始化ioc容器，会设置dispatcherServlet的地址
 * @JdkVersion: 17
 * @Author: yxy
 * @Created: 2023/12/1 14:34
 */
public class SpringMvcInit extends
        AbstractAnnotationConfigDispatcherServletInitializer {
    @Override
//    service mapper层的ioc容器配置
    protected Class<?>[] getRootConfigClasses() {
        return new Class[0];
    }

    @Override//设置我们项目对应的配置  springmvc controller
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{MvcConfig.class};
    }

    @Override//配置springmvc内部自带的servlet 的访问地址
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }
}
